{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([11.16541535,  7.57433165, 14.28572014,  9.62642717, 10.86227416])"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "V = np.array(\n",
    "    [[-7.72, -2.84, -7.55],\n",
    "     [ 0.79, 4.42, 6.10],\n",
    "     [-9.99, 4.24, 9.29],\n",
    "     [ 5.84, 7.65, 0.20],\n",
    "     [-6.85, 3.73, 7.56]])\n",
    "\n",
    "mag = np.linalg.norm(V,axis=1)\n",
    "\n",
    "mag"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.69142076, -0.25435686, -0.67619518],\n",
       "       [ 0.10429963,  0.58354984,  0.80535158],\n",
       "       [-0.69929971,  0.29679988,  0.65029973],\n",
       "       [ 0.60666329,  0.79468736,  0.02077614],\n",
       "       [-0.63062301,  0.34339034,  0.69598685]])"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "V = V/mag[:,np.newaxis]\n",
    "\n",
    "V"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
